# Contributor: Paul Bredbury <brebs@sent.com>
# Maintainer: Paul Bredbury <brebs@sent.com>
pkgname=icewm
pkgver=2.9.7
pkgrel=0
pkgdesc="Window manager designed for speed, usability and consistency"
url="https://github.com/ice-wm/icewm"
arch="all"
options="!check" # No test suite
license="LGPL-2.0-only"
subpackages="$pkgname-doc $pkgname-lang"
makedepends="alsa-lib-dev
	asciidoctor
	cmake
	fribidi-dev
	glib-dev
	imlib2-dev
	libao-dev
	libintl
	libsm-dev
	libsndfile-dev
	libxcomposite-dev
	libxdamage-dev
	libxft-dev
	libxinerama-dev
	libxpm-dev
	libxrandr-dev
	perl"

source="https://github.com/ice-wm/icewm/releases/download/$pkgver/icewm-$pkgver.tar.lz"

case "$CARCH" in
	s390x|riscv64)
		;;
	*)
		makedepends="$makedepends librsvg-dev"
		_arch_opts="-DCONFIG_LIBRSVG=ON"
		;;
	esac

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCFGDIR=/etc \
		-DENABLE_NLS=OFF \
		-DCONFIG_IMLIB2=ON \
		-DENABLE_LTO=ON \
		-DDOCDIR=/usr/share/doc/icewm $_arch_opts
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="
1ec2a73536a08f252d2c16f21b8d8646f4179ce025d6e828c6b9ae2405febe048ed4ab5c7d079a4a83cb4a83a5e027ae6ef1262ee0438c68f4d6124da552114d  icewm-2.9.7.tar.lz
"
